﻿<UserControl x:Class="ScrumFactory.Projects.HoursGraph"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             
             xmlns:SF_Comp="clr-namespace:ScrumFactory.Composition;assembly=ScrumFactory.Composition" 
             
             xmlns:props="clr-namespace:ScrumFactory.Projects.Properties"
             
             xmlns:visualization="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
             xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
             xmlns:chartPrmtvs="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit" 
           
             SF_Comp:CommandBehavior.RoutedEventName="Loaded"
             SF_Comp:CommandBehavior.TheCommandToRun="{Binding OnLoadCommand}"

             x:Name="thisView"
             
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>

        <charting:Chart Margin="0,10,0,0">
          
            <charting:Chart.Series>

                <charting:ColumnSeries                     
                    Title="{x:Static props:Resources.Worked_hours}"
                    ItemsSource="{Binding EffectiveHours}" 
                    DependentValueBinding="{Binding Hours}"
                    IndependentValueBinding="{Binding Name}"                    
                    DataPointStyle="{StaticResource GraphSerie1ColumnStyle}"   
                    LegendItemStyle="{StaticResource HorizontalLegendStyle}">
                </charting:ColumnSeries>

                <charting:ColumnSeries                     
                    Title="{x:Static props:Resources.Planned_hours}"
                    ItemsSource="{Binding PlannedHours}" 
                    DependentValueBinding="{Binding Hours}"
                    IndependentValueBinding="{Binding Name}"                                  
                    DataPointStyle="{StaticResource GraphSerie2ColumnStyle}"   
                    LegendItemStyle="{StaticResource HorizontalLegendStyle}">                    
                </charting:ColumnSeries>
    



            </charting:Chart.Series>

        </charting:Chart>
        
        <Grid x:Name="controls">
            <Slider HorizontalAlignment="Right" VerticalAlignment="Bottom" 
                Background="Transparent"                          
                Interval="1" Minimum="0" Maximum="3" Width="100"
                IsSnapToTickEnabled="True" Value="{Binding Zoom}"/>
            <TextBlock HorizontalAlignment="Right" VerticalAlignment="Bottom" Text="{Binding ZoomLegend}" 
                   FontSize="{StaticResource SmallFontSize}" Width="100" TextAlignment="Center"
                   Margin="0,0,0,20"/>
        </Grid>

        <StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Orientation="Horizontal">
            <TextBlock Foreground="{StaticResource GraphBGBrush1}">
                <TextBlock Text="{Binding TotalEffectiveHours}" FontSize="{StaticResource ReallyBigFontSize}" FontWeight="Bold" />    
                <TextBlock Text="{x:Static props:Resources.worked}" FontSize="{StaticResource SmallFontSize}"/>
            </TextBlock>
            <TextBlock Foreground="{StaticResource GraphBGBrush2}" Margin="15,0,0,0">
                <TextBlock Text="{Binding TotalPlannedHours}" FontSize="{StaticResource ReallyBigFontSize}" FontWeight="Bold"/>    
                <TextBlock Text="{x:Static props:Resources.planned}" FontSize="{StaticResource SmallFontSize}"/>
            </TextBlock>
            
        </StackPanel>
        
        
        <ContentControl           
            Grid.Row="0"
            HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Style="{StaticResource LoadingAnimationContent}"/>


    </Grid>
</UserControl>
